<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>下拉菜单</title>
</head>
<body>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            font-size: 30px;
            color: #f4f1de;
        }

        body {
            background-image: url(./背景9.jpg);
            background-size: 100%;
            align-items: center;
            justify-content: center;
            opacity: 0.9;
        }
        .shell{
            display: flex;
            justify-content: center;
        }
        .button,.portrait{
            background-color: #9810f3;
            width: 300px;
            height: 50px;
            text-align: center;
            line-height: 50px;
            transition: .3s;
            cursor: pointer;
        }
        .information{
            width: 220px;
            background-color: #f8d409;
            transform: translate(-20px,-200px);
            border-radius: 10px;
            padding: 20px 0;
            line-height: 0;
            height: 0;
            transition: .3s;
            opacity: 0;
            
        }
        .button:hover{
            background-color: #f8d409;
        }
        .button li:hover{
            background-color: #f8d409;
        }
        .button ul li{
            height: 0;
            transition: .2s;
            opacity: 0;
            transform: translateY(-65px);
            background-color: #f8d409;
        }
        .button:hover li{
            height: 65px;
            opacity: 1;
            transform: translateY(0);
        }
        .portrait:hover .information{
            opacity: 1;
            line-height: 65px;
            transform: translate(-5px,-100px);
            height: auto;
        }
        a{
            text-decoration: none;
        }
    </style>
</head>

<body>
    <ul class="shell">
        <li class="button">
            <span>1</span>
            <ul>
              <li>1</li>
                <li>2</li>
                <li>3</li>
                
            </ul>
        </li>
        <li class="button">
            <span>2</span>
            <ul>
                <li>1</li>
                  <li>2</li>
                  <li>3</li>
                  
              </ul>
        </li>
        <li class="button">
            <span>3</span>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
            </ul>
        </li>
        <li class="button">
            <span>4</span>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
            </ul>
        </li>
    </ul>
</body>

</html>

